﻿CREATE TABLE [dbo].[PiTablePermissionScope] (
    [Id]           INT            IDENTITY (1, 1) NOT NULL,
    [ParentId]     INT            NULL,
    [ItemCode]     NVARCHAR (40)  NULL,
    [ItemName]     NVARCHAR (100) NULL,
    [ItemValue]    NVARCHAR (100) NULL,
    [Enabled]      INT            DEFAULT ((1)) NOT NULL,
    [IsPublic]     INT            DEFAULT ((0)) NOT NULL,
    [AllowEdit]    INT            DEFAULT ((1)) NOT NULL,
    [AllowDelete]  INT            DEFAULT ((1)) NOT NULL,
    [DeleteMark]   INT            DEFAULT ((0)) NOT NULL,
    [SortCode]     INT            NULL,
    [Description]  NVARCHAR (800) NULL,
    [CreateOn]     DATETIME       DEFAULT (getdate()) NOT NULL,
    [CreateUserId] NVARCHAR (50)  NULL,
    [CreateBy]     NVARCHAR (50)  NULL,
    [ModifiedOn]   DATETIME       NULL,
    [ModifyUserId] NVARCHAR (50)  NULL,
    [ModifiedBy]   NVARCHAR (50)  NULL,
    CONSTRAINT [PK_PITABLEPERMISSIONSCOPE] PRIMARY KEY NONCLUSTERED ([Id] ASC)
);

